<?php
/**
 * Created by PhpStorm.
 * User: yuanluke
 * Date: 5/1/16
 * Time: 07:08
 */

namespace App\Http\Utils\Common;


use App\Http\Model\ConsoleAccountRole;
use App\Http\Model\PtAccountGoodsMid;
use App\Http\Model\PtGoods;
use App\Http\Model\ShopAccountRoleMid;

class RoleUtils {
    public static function getRoleId($account_id,$shop_id)
    {
        $result = ShopAccountRoleMid::where(['account_id'=>$account_id,'shop_id'=>$shop_id])->first();
        if($result != null){
            return $result->role_id;
        }
        return -1;
    }

    public static function getRightData($account_id,$ownto_id,$account_types)
    {
        return PtGoods::where('supp_id',$ownto_id)->pluck('id')->all();
//        return PtAccountGoodsMid::where(['account_id'=>$account_id,'ownto_id'=>$ownto_id,'account_types'=>$account_types])->pluck('goods_id')->all();
    }

}